/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.musiqueFaces.beans;

import com.musiqueFaces.data.DataFiller;
import com.musiqueFaces.model.Artist;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author peruvien
 */
@ManagedBean
@SessionScoped
public class ManagerArtistsBean {

    DataFiller dataFiller = new DataFiller();
    ArrayList<Artist> listArtists = new ArrayList();
    Artist artistTampon;

    /** Creates a new instance of ManagerArtistsBean */
    public ManagerArtistsBean() {
        listArtists = dataFiller.getArtistList();
    }

    public String updateArtist() {
        dataFiller.updateArtist(this.artistTampon.getId(), this.artistTampon.getFirstname(), this.artistTampon.getLastname());
        return "/faces/edition/mainPageMusiqueFaces.xhtml";
    }

    public DataFiller getDataFiller() {
        return dataFiller;
    }

    public void setDataFiller(DataFiller dataFiller) {
        this.dataFiller = dataFiller;
    }

    public ArrayList<Artist> getListArtists() {
        return listArtists;
    }

    public void setListArtists(ArrayList<Artist> listArtists) {
        this.listArtists = listArtists;
    }

    public Artist getArtistTampon() {
        return artistTampon;
    }

    public void setArtistTampon(Artist artistTampon) {
        this.artistTampon = artistTampon;
    }
    
}
